struct Container(i32, i32);

trait Contains<A, B> {
    fn contains(&self, _: &A, _: &B) -> bool;
    fn first(&self) -> i32;
    fn last(&self) -> i32;
}

impl Contains<i32, i32> for Container {
    fn contains(&self, _number1: &i32, _number2: &i32) -> bool {
        (&self.0 == _number1) && (&self.1 == _number2)
    }

    fn first(&self) -> i32 {
        self.0
    }

    fn last(&self) -> i32 {
        self.1
    }
}

fn difference<A, B, C>(container: &C) -> i32 where C: Contains<A, B> {
    container.last() - container.first()
}


fn main() {
    println!("Hello, world!");
    let number_1 = 3;
    let number_2 = 10;
    let container = Container(number_1, number_2);
    println!("Does container contain {} and {} : {}", &number_1, &number_2, container.contains(&number_1, &number_2));
    println!("First number {}", container.first());
    println!("Last number {}", container.last());

    println!("The difference is : {}", difference(&container));
}
